package com.wmtiger.utils.array 
{
	/**
	 * ...
	 * @author wmTiger
	 */
	public class VectorUtil 
	{
		
		public function VectorUtil() 
		{
			
		}
		
		/**
		 * 查找向量数组中是否有某个元素
		 * @param vector
		 * @param value
		 * @return 
		 * 
		 */		
		public static function contains(vector:Vector.<Object>, value:Object):Boolean
		{
			var len:int = vector.length;
			var i:int;
			
			for(i = len - 1; i > -1; i--)
			{
				if(vector[i] === value)
				{
					return true;
				}
			}
			return false;
		}
		
		/**
		 * 删除向量数组<Object>中的某个Object
		 * @param	vector
		 * @param	value
		 */
		public static function removeValueFromFuncVector(vector:Vector.<Object>, value:Object):void
		{
			var len:int = vector.length;
			var i:int;
			
			for(i = len - 1; i > -1; i--)
			{
				if(vector[i] === value)
				{
					vector.splice(i, 1);
					return;
				}
			}					
		}
		
	}

}